#ifndef _EB0_RENDERABLE_H_
#define _EB0_RENDERABLE_H_

#include <EB0/Prereq.h>
#include <SFML/Graphics.hpp>

namespace EB0
{
namespace Graphics
{
	// This class is designed to be very similar to SFML's Drawable
	// Only that it will work exclusively with the SceneManager
	class Renderable : public sf::Drawable
	{
	public:
		static bool compare(const Renderable& lhs, const Renderable& rhs);
		static bool comparePtr(const Renderable* lhs, const Renderable* rhs);

		Renderable(float zindex = 0.0f);
		Renderable(sf::Drawable* drawable, float zindex = 0.0f);
		~Renderable();

		void setDrawable(sf::Drawable* drawable);
		sf::Drawable* getDrawable() const;
		void removeDrawable();

		virtual bool inView(sf::View& view) const;

		// Public members do not have the m prefix
		float z; // for layering, higher z-values are drawn later

	protected:
		sf::Drawable* mDrawable;

	private:
		virtual void Render(sf::RenderTarget& Target) const; // called through RenderWindow
	};
} // namespace Graphics
}

#endif // _EB0_RENDERABLE_H_